Repository navigation
Editor: no live completion and no snippets (P31); P29b and the double tap checked - #28
Merged
Merged
Conversation
LiaScript 2.1.1 turns on live autocompletion and snippets for every executable block: "if" + Enter or + Tab became a whole statement, also in a docstring. The macro switches both off, like tabSize, unless the block's data-ace-options sets them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two parts: P31 (completion and snippets off) changes the macro. For P29b (failing doctests) and the double tap, my tests found nothing to fix, so there's no code change for them.
P31: no live completion and no snippets in glpython blocks
Since LiaScript 2.1.1, every executable block completes as one types and expands snippets.
if+ Enter (or + Tab) becameif condition:/# TODO: write code..., also in a docstring.The macro now sets
enableLiveAutocompletion = falseandenableSnippets = falseon the block'slia-editors. It works the same way as the existingtabSize/useSoftTabs(inindentWithSpaces, run fromattach()on every re-render):data-ace-optionsthat names one of the two options wins.Ctrl+Space stays (
enableBasicAutocompletion). It only opens on request; without snippets it offers keywords and the block's own words, and Escape closes it. On the iPad there's usually no Ctrl+Space at all.README («The macro makes the block's editor indent…») and CLAUDE.md are updated.
Tested (Chrome, headless, hosted LiaScript player, local course
version: 1.0.0)mainif+ Enterif condition:+# TODO…if+ Tabif+ Enter = new linedata-ace-options="enableLiveAutocompletion=true enableSnippets=true"P29b: «Tests» with failing doctests – not reproduced
The same test as in #27, now with failing doctests, run with the macro from
main. I recorded LiaScript's IndexedDB record (codestore) right after the click and after the result.3 * x)glpython:testnoten.py/main.py, comment inmain.pyglpython:testmain.py… / 3 + 7glpython:testglpython:testglpython:test+ xyz(NameError in every example)glpython:testglpython:testeachPassing doctests (#27's table) are kept as before.
From LiaScript's source, too:
Evalstores the new version (appendVersion→updateAppend) at the click, and the result only updates that version's log. The writes run in Dexie transactions, so they can't overwrite each other.Double tap on «Tests»: no problem
dblclick)glpython:test,glpython:testglpython:test,glpython:testglpython:test,glpython:testclick()calls in the same task (faster than any person)glpython:test,glpython:testLiaScript runs the block's script synchronously inside the click on its run button. So
commandAfterLiaRunis used up before the second click can overwrite it: the single slot is enough, and noglpython:runfollows. No change.Manual tests
Chrome on the desktop:
main.pytype a docstring line ending inif, press Enter: new line, no popup. The same with Tab: spaces, no snippet.iPad (Safari, software and hardware keyboard if available):
4. Same as 1. With the software keyboard:
ifthen the return key gives a new line, no popup.5. Typing a whole word with the software keyboard's suggestions (QuickType) still works normally.
6. P29b: change
main.pyso the doctests fail, «Tests», close the tab, open the course again: the change is there.Follow-ups (not fixed here)
indexedDB.openfrom Playwright'spage.evaluatesometimes throwsSecurityError: Blocked by policy, until a reload. LiaScript itself keeps storing (it holds its connection from loading: verified with a further change and reload). It only matters for scripts that read IndexedDB: read once right after loading.```textexercises with a LiaScript script) still have live completion; the macro only touches its own block.Snippet: what LiaScript stored for the slide's code
Run it once right after loading the slide, then again after «Tests»: right after the click, the active version should be the new code.
🤖 Generated with Claude Code